﻿using UnityEngine;
using System.Collections;
using System.Collections.Generic;
using Dict.DataModel;

namespace Dict.Blo
{
    public class DictSkillCastBlo
    {
        public static float GetSkillAddAnger(string id)
        {
            float anger = 0;
            List<TableSkillCast> list = Dict.DictDataManager.Instance.tableSkillCastDao.GetByOneIndex(id);
            foreach(var cast in list)
            {
                anger += (float)cast.AddAnger;
            }

            return anger;
        }

        public static double GetSkillExportFactor(string id)
        {
            double factor = 0;
            List<TableSkillCast> list = Dict.DictDataManager.Instance.tableSkillCastDao.GetByOneIndex(id);
            foreach (var cast in list)
            {
                factor += cast.ExportFactor;
            }

            return factor;
        }
        /// <summary>
        /// 返回技能的最后一个类型
        /// </summary>
        /// <param name="id"></param>
        /// <returns></returns>
        public static int GetSkillExportType(string id)
        {
            List<TableSkillCast> list = Dict.DictDataManager.Instance.tableSkillCastDao.GetByOneIndex(id);
            return list[list.Count -1].ExportType;
        }
    }
}

